#######################################
# Order of the Sacred Magdalene
# Troop Carnal Rite Events
#
# GGSM-owned troop carnal rite events.
#######################################

namespace = ggsmtroop


#######################################
# TROOP CARNAL RITE
#
# The generic CR event can cause pregnancy through
# WoL.97 and impregnate = 0. Neither is used here.
#######################################

long_character_event = {
	id = ggsmtroop.1
	desc = ggsmtroop.1.desc
	picture = GFX_event_ggsm_gangbang_troops
	border = GFX_event_long_frame_religion
	is_triggered_only = yes

	trigger = {
		is_female = yes
		is_adult = yes
		religion = catholic
		society_member_of = ggsm_order_sacred_magdalene
		in_command = yes
		has_character_flag = ggsm_gangbanged_troops
	}

	option = {
		name = ggsmtroop.1.a

		# The public rite binds the army more closely to its commander.
		add_character_modifier = {
			name = cr_troops_carnal_rite
			duration = 30
		}

		# This is an Order-sanctioned act, so there is
		# no adulteress penalty and no pregnancy roll.
		ggsm_progress_sacred_prostitution_effect = yes
		add_society_currency_minor_effect = yes

		hidden_tooltip = {

			# Preserve the original physical exhaustion risk.
			if = {
				limit = { trait = weak }
				random = {
					chance = 10
					add_trait = ill
				}
			}

			if = {
				limit = { NOT = { trait = strong } }
				random = {
					chance = 5
					add_trait = ill
				}
			}

			# Feed the rite into CR's religion-wide lust meter.
			set_variable = {
				which = lust_increase
				value = 2
			}
			character_event = { id = cr_lust.3 }
		}
	}
}


#######################################
# SIX-MONTH RECOVERY
#######################################

long_character_event = {
	id = ggsmtroop.2
	hide_window = yes
	is_triggered_only = yes

	immediate = {
		clr_character_flag = ggsm_gangbanged_troops
	}
}


#######################################
# GENERIC CR TROOP CARNAL RITE
#
# Kept in this submod for compatibility
# with its non-Order troop decision.
#######################################

long_character_event = {
	id = ggsmtroop.3
	desc = ggsmtroop.3.desc
	picture = GFX_evt_lovers
	border = GFX_event_long_frame_war
	is_triggered_only = yes

	trigger = {
		is_female = yes
		is_adult = yes
		lustful_religion = yes
		NOT = { society_member_of = ggsm_order_sacred_magdalene }
		in_command = yes
		has_character_flag = cr_gangbanged_troops
	}

	option = {
		name = ggsmtroop.3.a

		add_character_modifier = {
			name = cr_troops_carnal_rite
			duration = 30
		}

		hidden_tooltip = {
			any_realm_character = {
				limit = {
					is_female = no
					is_adult = yes
					in_command = yes
					ai = yes
					NOR = {
						trait = chaste
						trait = celibate
						trait = incapable
						spouse = { character = ROOT }
						is_lover = ROOT
					}
				}
				character_event = { id = WoL.97 }
			}

			if = {
				limit = {
					is_pregnant = no
					NOT = { age = 45 }
				}
				random = {
					chance = 50
					impregnate = 0
				}
			}

			if = {
				limit = { trait = weak }
				random = {
					chance = 10
					add_trait = ill
				}
			}
			if = {
				limit = { NOT = { trait = strong } }
				random = {
					chance = 5
					add_trait = ill
				}
			}
			if = {
				limit = { is_married = yes }
				add_character_modifier = { name = adulteress duration = 300 }
			}

			set_variable = { which = lust_increase value = 2 }
			character_event = { id = cr_lust.3 }
		}
	}
}


long_character_event = {
	id = ggsmtroop.4
	hide_window = yes
	is_triggered_only = yes

	immediate = {
		clr_character_flag = cr_gangbanged_troops
	}
}
